/**
 * 获取GET请求内容
 * 
 *  http://localhost:3000/user?name=菜鸟教程&url=www.runoob.com
 */

var http = require('http');
var url = require('url');
var util = require('util');
 
http.createServer(function(req, res){
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end(util.inspect(url.parse(req.url, true).query));
}).listen(3000);

// { name: '菜鸟教程', url: 'www.runoob.com' }